package com.huawei.service.impl;


import com.huawei.dao.DdkuaizhaoMapper;
import com.huawei.dao.DingdanMapper;
import com.huawei.entity.Ddkuaizhao;

import com.huawei.service.DdkuaizhaoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @ClassName DdkuaizhaoImpl
 * @Description TODO
 * @Author 马效鹏
 * @Date 2021/11/29 18:12
 */
    @Service
public class DdkuaizhaoImpl implements DdkuaizhaoService {
    @Resource
    DdkuaizhaoMapper ddkuaizhaoMapper;
    @Resource
    DingdanMapper dingdanMapper;
    @Override
    public List<Ddkuaizhao> selectAll(Map<String, Object> pars) {
        List<Ddkuaizhao> list=ddkuaizhaoMapper.selectAll(pars);
        for(Ddkuaizhao n:list){
            n.setDingdan1(dingdanMapper.getId(n.getDingdan_id()));
        }

        return list;
    }

    @Override
    public int count(Map<String, Object> pars) {
        return ddkuaizhaoMapper.count(pars);
    }

    @Override
    public int add(Ddkuaizhao ddkuaizhao) {

            return ddkuaizhaoMapper.add(ddkuaizhao);

    }

    @Override
    public int update(Ddkuaizhao ddkuaizhao) {

            return ddkuaizhaoMapper.update(ddkuaizhao);


    }

    @Override
    public int delete(int kuaizhao_id) {
        return ddkuaizhaoMapper.delete(kuaizhao_id);
    }


}
